/**
 * Candidate number: 35834
 */
package tv.starfu.sequencer;

import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.NiftyEventSubscriber;
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.elements.events.NiftyMousePrimaryClickedEvent;
import de.lessvoid.nifty.input.NiftyMouseInputEvent;
import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.nifty.screen.ScreenController;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
//import net.beadsproject.beads.play.Pattern;

public class TrillianScreenController implements ScreenController {
    
    private Nifty nifty;
    private Screen screen; 
    
    public TrillianScreenController() {
        
    }

    public void bind(final Nifty nifty, final Screen screen) {
        this.nifty = nifty;
        this.screen = screen;
    }

    public void onStartScreen() {
      
    }

    public void onEndScreen() {
        
    }
    
    /* Defines a method that can be called from elemental children */
    public void next(String p1, String p2) {
        System.out.println("Woohoo!! " + p1 + p2);
    }
    
    /* Getting Mouse Coordinates */
    public void nextGrid(int x, int y) {
        System.out.println("nextGrid() clicked at: " + x + ", " + y);
    }
    
    /* MouseOver colour change */
    public void changeThePicture(Element e, NiftyMouseInputEvent ev) {
        String id = e.getId();
        System.out.println("I can fly!" + id);
    }
    
    // Listen to Nifty Mouse Click Events at all elements whose id begins with "drum"
    // pattern : a regular expression identfying participating elements
    // id : elementID of the publisher
    @NiftyEventSubscriber(pattern="drum.*")
    public void onClick(String id, NiftyMousePrimaryClickedEvent event) {
        System.out.println("Element with ID[" + id + "] clicked at [" + event.getMouseX() + ", " + event.getMouseY()+ "]");
        
        // Update Model/Patterns
    }
    
}
